import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

import net.sf.json.JSONObject;

import org.junit.Test;

import com.sinosoft.svc.entity.ReceiveReportInfoData;


public class test {
	@Test
	public void test3() throws IOException{
      OutputStream out = new FileOutputStream("D:\\demo.txt",true);//打印到文件  
        OutputStreamWriter osr = new OutputStreamWriter(out);//输出  
//      OutputStreamWriter osr = new OutputStreamWriter(new FileOutputStream("D:\\demo.txt"));//两句可以综合到一句。  
        ReceiveReportInfoData receiveReportInfoData=new ReceiveReportInfoData();
		receiveReportInfoData.setSendId("123");
		receiveReportInfoData.setTelephone("223");
		receiveReportInfoData.setReserve("323");
		JSONObject jsonObject = JSONObject.fromObject(receiveReportInfoData);

        osr.write(jsonObject.toString());  
       // osr.write("");
        osr.flush();  
        osr.close();  
    }  
}
